/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prototipos;

import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;

/**
 *
 * @author Hugo
 */
public class Inicio_panel extends javax.swing.JPanel {

    /**
     * Creates new form Inicio_panel
     */
    Jogo j;
    public Inicio_panel(Jogo j) {
        
        initComponents();
        this.j=j;
    }

    public Cursor setCursor(int i)
    {
        Image image;
        Toolkit tk = Toolkit.getDefaultToolkit();
        if(i==1)
            image = tk.getImage(getClass().getResource("/imagens/up.png"));
        else
            image = tk.getImage(getClass().getResource("/imagens/down.png"));
        
        Cursor cursor = tk.createCustomCursor(image, getLocation(), "meuCursor");
        
        
        return cursor;
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bt_um_jogador = new javax.swing.JButton();
        bt_dois_jogadores = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setLayout(null);

        bt_um_jogador.setToolTipText("");
        bt_um_jogador.setBorder(null);
        bt_um_jogador.setContentAreaFilled(false);
        bt_um_jogador.setCursor(setCursor(1));
        bt_um_jogador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_um_jogadorActionPerformed(evt);
            }
        });
        add(bt_um_jogador);
        bt_um_jogador.setBounds(0, 0, 390, 180);

        bt_dois_jogadores.setBorder(null);
        bt_dois_jogadores.setContentAreaFilled(false);
        bt_dois_jogadores.setCursor(setCursor(2));
        bt_dois_jogadores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_dois_jogadoresActionPerformed(evt);
            }
        });
        add(bt_dois_jogadores);
        bt_dois_jogadores.setBounds(713, 363, 290, 290);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/1ºpagina.png"))); // NOI18N
        add(jLabel1);
        jLabel1.setBounds(0, 0, 1000, 650);
    }// </editor-fold>//GEN-END:initComponents

    private void bt_um_jogadorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_um_jogadorActionPerformed
        
        j.setTipoJog(1);
        j.getEcra().getInicio_panel().setVisible(false);
        j.getEcra().getLogin1_panel().setVisible(true);
        
    }//GEN-LAST:event_bt_um_jogadorActionPerformed

    private void bt_dois_jogadoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_dois_jogadoresActionPerformed
        j.setTipoJog(2);
        j.getEcra().getInicio_panel().setVisible(false);
        j.getEcra().getLogin2_panel().setVisible(true);
    }//GEN-LAST:event_bt_dois_jogadoresActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_dois_jogadores;
    private javax.swing.JButton bt_um_jogador;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
